<template>
	<view class="">
		<view class="flex align-center" v-for="(item,index) in list" :key="index">
			<image :src="item.logo" mode="" style="width: 100upx;"></image>
			<view class="">{{item.companyName}}</view>
		</view>
	</view>
</template>

<script setup lang="ts">
import { ref } from 'vue';
import {ID,KEY} from '../../config/index'
import {http,myhttp} from '../../utils/http'
import type {CompanyType} from '../../model/company'
// 方法一
// uni.request({
// 	url:'https://5ggijjsn.lc-cn-n1-shared.com/1.1/classes/Company',
// 	header:{
// 		"X-LC-Id": ID,
// 		"X-LC-Key": KEY,
// 		"Content-Type": "application/json"
// 	},
// 	success:(res)=>{
// 		console.log(res);
// 	}
// })

// 方法二：三方库
const list = ref<Array<CompanyType>>()
http.get('/classes/Company').then((res)=>{
	console.log('三方库请求数据',res);
	list.value = res.data.results
})
//方法三：自定义封装
myhttp.get('/classes/Company').then((res:any)=>{
	console.log('自定义封装请求数据',res);
	list.value = res.data.results
})
//自定义post
myhttp.post('/classes/Company',{
        "companyId": "1",
        "companyName": "字节跳动",
        "category": "AI产品",
        "companyIntroduction": "字节跳动成立于2012年，是一家全球知名的科技公司，旗下拥有抖音、今日头条、西瓜视频等众多热门产品，致力于为全球用户提供优质的信息服务和创新的科技体验。",
        "address": "北京市海淀区北三环西路甲23号",
        "latitude": 39.9847,
        "longitude": 116.3189,
        "legalRepresentative": "张一鸣",
        "registeredCapital": "3000万美元",
        "establishmentTime": "2012-03-09",
        "industry": "IT/互联网",
        "website": "https://www.bytedance.com",
        "recruitmentEmail": "hr@bytedance.com",
        "logo": "https://svglogo.top/library/social/douYin.svg",
        "tags": ["短视频", "人工智能", "全球化", "独角兽"],
        "financingStage": "已上市",
        "companySize": "10000人以上",
        "companySizeDetail": "15000-20000人",
        "employeeRating": 4.2,
        "position": "Android开发工程师",
        "salary": "15k-30k",
        "workLocation": "北京、上海、广州",
        "jobRequirements": "本科及以上学历，计算机相关专业，熟悉Android开发框架，有良好的Java或Kotlin编程基础，有实际项目经验者优先。",
        "welfare": "五险一金、带薪年假、餐补、交通补、年终奖、节日福利"
    }).then((res:any)=>{
	console.log('自定义封装post数据',res);
})


</script>

<style>

</style>
